/**
 * All rights reserved by DigitNexus Technology INC.
 */
package com.xspace.android.xafcommon.download;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

import android.graphics.drawable.Drawable;

public class GainDrawable {
 private static GainDrawable instance;
 public static GainDrawable getInstance(){
	 if(instance == null){
		 instance = new GainDrawable();
	 }
	 return instance;
 }

 public Drawable getDrawable(String filePath,String name){
	 Drawable d = null;
     FileInputStream fis = null;
     if (FileUtils.isExists(filePath)){
         try {
             fis = new FileInputStream(filePath);
             d = Drawable.createFromStream(fis, name);
         } catch (FileNotFoundException e) {
             e.printStackTrace();
         } finally {
             if (fis != null) {
                 try {
                     fis.close();
                 } catch (IOException e) {
                     e.printStackTrace();
                 }
                 fis = null;
             }
         }
     }
     return d;
 }
}
